<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <link rel="stylesheet" href="/semantic/dist/semantic.min.css">
  <link rel="stylesheet" href="/node_modules/bootstrap/dist/css/bootstrap.min.css">
  <script src="/node_modules/jquery/dist/jquery.min.js"></script>
  <script src="/node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
  <!-- 注意：semantic.min.js 依赖于 Jquery -->
  <script src="/semantic/dist/semantic.min.js"></script>
  <script src="/node_modules/art-template/lib/template-web.js"></script>
  <link rel="stylesheet" href="./index.css">
  <script src="./index.js"></script>
</head>

<body>
  <h1>英雄列表</h1>
  <nav aria-label="Page navigation" class="fenye">
    <ul class="pagination">
      <li>
        <a href="#" aria-label="Previous">
          <span aria-hidden="true">&laquo;</span>
        </a>
      </li>
      <li><a href="#">1</a></li>
      <li><a href="#">2</a></li>
      <li><a href="#">3</a></li>
      <li><a href="#">4</a></li>
      <li><a href="#">5</a></li>
      <li>
        <a href="#" aria-label="Next">
          <span aria-hidden="true">&raquo;</span>
        </a>
      </li>
    </ul>
  </nav>
  <button class="ui primary button" id="add">添加英雄</button>

  <!-- 表格区域 -->
  <table class="ui celled striped blue table">
    <thead>
      <tr>
        <th>编号</th>
        <th>英雄名称</th>
        <th>性别</th>
        <th>创建时间</th>
        <th>操作</th>
      </tr>
    </thead>
    <tbody id="tbd">
      <!-- 模板 -->
    </tbody>
  </table>

  <!-- 对话框 -->
  <div class="ui tiny modal">
    <div class="header">
      添加新英雄
    </div>
    <div class="content">
      <form class="ui form">
        <div class="field">
          <label>名称：</label>
          <input type="text" name="name" placeholder="请输入英雄名称" id="mc">
        </div>
        <div class="field">
          <label>性别：</label>
          <select name="gender" class="ui fluid dropdown" id="gender">
            <option value="男">男</option>
            <option value="女">女</option>
          </select>
        </div>
      </form>
    </div>
    <div class="actions">
      <div class="ui black deny button">
        取消
      </div>
      <div class="ui positive right button" id="btnAdd">
        添加
      </div>
    </div>
  </div>
  <script type="text/html" id="hero">
 {{each data}}
   <tr>
    <td>
      <div class="ui ribbon label {{$value.isdel==1?'red':'blue'}}">{{$value.isdel==1?'删除':'正常'}}</div>
      {{$value.id}}
    </td>
    <td class="hname">{{$value.name}}</td>
    <td class="hgender">{{$value.gender}}</td>
    <td class="hctime">{{$value.ctime}}</td>
    <td>
      <a href="javascript:;" data-id="{{$value.id}}" id="edit">编辑</a>
      <a href="javascript:;" data-id="{{$value.id}}" data-del="{{$value.isdel}}" id="del">{{$value.isdel==1?'撤销':'删除'}}</a>
      <a href="javascript:;" data-id="{{$value.id}}" id="delhero">彻底删除</a>
    </td>
  </tr>
 {{/each}}
</script>
</body>

</html>